﻿using System;
using System.Collections.Generic;
using System.Text;
using WindowsFormsAero;

namespace BGShell.Controls
{
    [System.ComponentModel.DesignerCategory("Code")]
    public abstract class BGShellTabPage : AeroTabPage
    {
        public abstract void OpenAsync();
        public abstract void CloseAsync();

        protected void RemovePage()
        {
            var exitCodePage = this as IExitCodeTabPage;

            if (exitCodePage != null)
            {
                TabControl.LastExitCode = exitCodePage.ExitCode;
            }

            TabControl.TabPages.Remove(this);
        }

        protected internal bool IsBackgroundWindow
        {
            get;
            internal set;
        }

        internal new BGShellTabControl TabControl
        {
            get { return (BGShellTabControl)(base.TabControl); }
        }
    }

    public interface IExitCodeTabPage
    {
        int ExitCode { get; }
    }

    public interface IZoomableTabPage
    {
        float ZoomFactor
        {
            get;
            set;
        }
        event EventHandler ZoomFactorChanged;
    }

    public interface IEditableTabPage
    {
        bool CanCut { get; }
        bool CanCopy { get; }
        bool CanPaste { get; }
        bool CanSelectAll { get; }

        void Cut();
        void Copy();
        void Paste();
        void SelectAll();
    }
#if HELP
    public interface ITabPageWithHelp
    {
        BGShellHelpTopic HelpTopic { get; }
    }
#endif
}
